<template>
    <div>
        <Header></Header>
        <div class="article_list">
            <ul>
                <li v-for="item in list">
                    <time>{{$utils.goodTime(item.create_at)}}</time>
                    <router-link :to="'/content/'+item.id">
                        {{item.title}}
                    </router-link>
                </li>
            </ul>
        </div>
        <Footer></Footer>
    </div>
</template>

<script>
    import Header from '../components/header.vue'
    import Footer from '../components/footer.vue'
    export default{
        components:{Header,Footer},
        data(){
            return{
              list:[]
            }
        },
        created(){
            this.getData()
        },
        methods:{
            getData(){
                this.$api.get('topics',null,r=>{
                    this.list = r.data
                })
            }
        }
    }
</script>

<style scoped>
    .article_list{font-size:14px}
    .article_list ul li time{color:#999}
</style>